<template>
	<view class="content-box">
		<view class="list-box" v-for="(item,index) in list" :key="index" @click="click_to(item)" :style="{height: type=='text'?'320rpx':'480rpx'}">
			<view class="image-box" :style="{height: type=='text'?'175rpx':'280rpx'}">
				<image :style="{height: type=='text'?'175rpx':'280rpx'}" :src="item.imageUrl || item.imgUrlList[0]" ></image>
			</view>
			<view class="title sl11">{{item.name}}</view>
			<view class="pay-box" v-if="type=='img'">￥{{item.price}}</view>
			<!-- #ifdef MP-WEIXIN -->
			<view class="pay-box" :style="{bottom: type=='text'?'20rpx':''}" v-if="type=='text'">
				<text>￥{{item.price}}</text>
			</view>
			<!-- #endif -->
			<!-- #ifdef APP-PLUS -->
			<view class="pay-box" :style="{bottom: type=='text'?'20rpx':''}" v-if="type=='text'">
				<image src="/static/doudoux.png"></image>
				<text>{{item.price}}</text>
			</view>
			<!-- #endif -->
			<view class="bdbz" v-if="type=='img'">
				<view class="a">保底中</view>
				<view class="b">{{item.priceRange}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"product-list",
		props: {
			list: {
				type: Array
			},
			type:{
				type: String,
				default: 'text'
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			click_to(item) {
				this.$emit('click_to',item);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content-box{
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}
	.list-box {
		width: 328rpx;
		height: 361rpx;
		background: #FFFFFF;
		border-radius: 16rpx;
		box-sizing: border-box;
		padding: 20rpx 24rpx 24rpx 24rpx;
		margin-top: 20rpx;
		overflow: hidden;
		position: relative;
		.image-box {
			width: 100%;
			height: 280rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			image {
				width: 280rpx;
				height: 280rpx;
			}
		}
		
		.title {
			width: 100%;
			margin-top: 15rpx;
			font-size: 28rpx;
			font-weight: bold;
			color: #333333;
		}
		
		.pay-box {
			width: 100%;
			position: absolute;
			left: 0;
			bottom: 80rpx;
			box-sizing: border-box;
			padding: 0 24rpx;
			font-size: 28rpx;
			font-weight: bold;
			color: #F02038;
			display: flex;
			align-items: center;
			image{
				width: 32rpx;
				height: 30rpx;
				margin-right: 5rpx;
			}
		}
		.bdbz{
			width: 100%;
			position: absolute;
			left: 0;
			bottom: 30rpx;
			box-sizing: border-box;
			padding: 0 24rpx;
			display: flex;
			align-items: center;
			.a{
				width: 100rpx;
				height: 36rpx;
				line-height: 36rpx;
				text-align: center;
				font-size: 20rpx;
				font-weight: bold;
				color: #FFFFFF;
				background: linear-gradient(90deg, #FF624C 0%, #FF3B82 100%);
			}
			.b{
				width: 138rpx;
				height: 36rpx;
				line-height: 36rpx;
				text-align: center;
				background: rgba(255, 62, 62, 0.08);
				font-size: 20rpx;
				font-weight: bold;
				color: #FF3E7E;
			}
		}
	}
</style>